package com.iwhalecloud.bss.kite.cucc.service.pos.bcmc.dispatcher.impl;

import java.util.List;

import com.iwhalecloud.bss.kite.common.chain.HandlerExecutionChain;
import com.iwhalecloud.bss.kite.common.chain.IHandler;
import com.iwhalecloud.bss.kite.cucc.service.pos.bcmc.BcmcPosContext;
import com.iwhalecloud.bss.kite.cucc.service.pos.bcmc.dispatcher.IBcmcOrderDispatcher;

public abstract class AbstractBcmcOrderDispatcher implements IBcmcOrderDispatcher {

    @Override
    public void invoke(BcmcPosContext context) {
        // 1.创建调度责任链
        HandlerExecutionChain<BcmcPosContext> chain = new HandlerExecutionChain<>();

        // 2.加载处理器
        chain.addHandlers(registerHandlers());

        // 3.执行处理器
        chain.doHandle(context);

    }

    @Override
    public List<IHandler<BcmcPosContext>> registerHandlers() {
        // 子类实现
        return null;
    }

}
